From a79c7ead42bab997f90dcefc33dd4df0c6677c0f Mon Sep 17 00:00:00 2001 From: Mikko Perttunen Date: Mon, 2 Mar 2015 19:09:05 +0200 Subject: [PATCH] Add test for having lto enabled while having a build script --- tests/test_cargo_compile_custom_build.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/test_cargo_compile_custom_build.rs b/tests/test_cargo_compile_custom_build.rs index 5ef4c238f..90b617cc2 100644 --- a/tests/test_cargo_compile_custom_build.rs +++ b/tests/test_cargo_compile_custom_build.rs @@ -1099,3 +1099,24 @@ test!(profile_and_opt_level_set_correctly { assert_that(build.cargo_process("bench"), execs().with_status(0)); }); + +test!(build_script_with_lto { + let build = project("builder") + .file("Cargo.toml", r#" + [package] + name = "builder" + version = "0.0.1" + authors = [] + build = "build.rs" + + [profile.dev] + lto = true + "#) + .file("src/lib.rs", "") + .file("build.rs", r#" + fn main() { + } + "#); + assert_that(build.cargo_process("build"), + execs().with_status(0)); +}); -- 2.30.2